<?php

namespace App\model;

use Illuminate\Database\Eloquent\Model;

/**
 * App\model\CustomerLevel
 *
 * @property int $customer_level_id
 * @property string|null $name 客户等级
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\CustomerLevel newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\CustomerLevel newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\CustomerLevel query()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\CustomerLevel whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\CustomerLevel whereCustomerLevelId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\CustomerLevel whereName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\CustomerLevel whereUpdatedAt($value)
 * @mixin \Eloquent
 */
class CustomerLevel extends Model
{
    protected $table='customer_level';
    protected $primaryKey='customer_level_id';
    public static function getSelectOptions()
    {
        $options = \DB::table('customer_level')->select('customer_level_id as id','name as text')->get();
        $selectOption = [];
        foreach ($options as $option){
            $selectOption[$option->id] = $option->text;
        }
        return $selectOption;
    }
}
